package com.yc.sign.web.bean;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.List;

/**
 * Company 源辰信息
 *
 * @author navy
 * @date 2024/8/25
 * Email haijunzhou@hnit.edu.cn
 */
@Component
@ConfigurationProperties(prefix = "sign")
@Data
public class SignProperties {
    boolean enable;
    String userTable;
    String usernameColumn;
    String passwordColumn;
    String emailColumn;
    String userClass;
    String sessionKey;
    List<String> urls;
    String loginHtml;
    String encryption;  // MD5 or SHA or 空字符串

    Class UserClassObject;

    @PostConstruct
    void init() throws ClassNotFoundException {
        if(userClass!=null){
            UserClassObject = Class.forName(userClass);
        }
    }
}
